<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
<%@ include file="../../base.jsp"%>
<!DOCTYPE html>
<html>

<head>
    <!-- 页面meta -->
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>数据 - AdminLTE2定制版</title>
    <meta name="description" content="AdminLTE2定制版">
    <meta name="keywords" content="AdminLTE2定制版">
    <!-- Tell the browser to be responsive to screen width -->
    <meta content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no" name="viewport">
    <!-- 页面meta /-->
</head>
<body>
<div id="frameContent" class="content-wrapper" style="margin-left:0px;">
    <!-- 内容头部 -->
    <section class="content-header">
        <h1>
            基本信息
            <small>产品信息</small>
        </h1>
        <ol class="breadcrumb">
            <li><a href="all-admin-index.html"><i class="fa fa-dashboard"></i> 首页</a></li>
            <li><a href="all-order-manage-list.html">基本信息</a></li>
            <li class="active">产品信息</li>
        </ol>
    </section>
    <!-- 内容头部 /-->

    <!-- 正文区域 -->
    <section class="content">

        <!--订单信息-->
        <div class="panel panel-default">
            <div class="panel-heading">编辑产品</div><%-- enctype="multipart/form-data"--%>
            <form id="editForm" action="/baseinfo/product/edit.do" method="post">
                <input type="hidden" name="id" value="${factoryProduct.id}">
                <input type="hidden" name="factoryId" id="factoryId" value="${factoryProduct.factoryId}">

                <div class="row data-type" style="margin: 0px">

                    <div class="col-md-2 title">生产厂家</div>
                    <div class="col-md-4 data">
                        <select class="form-control" name="describeFactory" id="factoryName" onchange="document.getElementById('factoryName').value=this.options[this.selectedIndex].text">
                            <option value="">请选择</option>
                            <c:forEach items="${factoryList}" var="factory">
                                <option value="${factory.factoryName}" ${factoryProduct.factoryId eq factory.id ? "selected" : ""}>
                                        ${factory.factoryName}
                                </option>
                            </c:forEach>
                        </select>
                    </div>



                    <div class="col-md-2 title">产品类别</div>
                    <div class="col-md-4 data">
                        <select class="form-control"  name="ctype" id="ctype" onchange="document.getElementById('ctype').value=this.options[this.selectedIndex].text">
                            <option value="">请选择</option>
                            <c:forEach items="${ctypeList}" var="ctype">
                                <option value="${ctype}" ${factoryProduct.ctype eq ctype ? "selected" : ""}>
                                        ${ctype}</option>
                            </c:forEach>
                        </select>
                    </div>

                    <div class="col-md-2 title">产品名称</div>
                    <div class="col-md-4 data">
                        <input type="text" class="form-control" placeholder="产品名称" name="synopsis" value="${factoryProduct.synopsis}">
                    </div>


                <%--<div class="col-md-2 title">产品照片</div>--%>
                    <%--<div class="col-md-4 data">--%>
                        <%--<input type="file" class="form-control" placeholder="产品照片" name="pImg" >--%>
                    <%--</div>--%>

                    <%--<c:if test="${not empty factoryProduct.pImg && !(factoryProduct.pImg eq null) }">--%>
                    <%--<div class="col-md-2 title">产品照片</div>--%>
                    <%--<div class="col-md-4 data">--%>
                        <%--<c:if test="${not empty  factoryProduct.pImg && !(factoryProduct.pImg eq null) }">--%>
                            <%--<img src="${factoryProduct.pImg}" width="300px" height="180px">--%>
                            <%--<input type="hidden" name="pImg" value="${factoryProduct.pImg}">--%>
                        <%--</c:if>--%>

                    <%--</div>--%>
                    <%--</c:if>--%>
                    <%--<c:if test="${empty factoryProduct.pImg || (factoryProduct.pImg eq null) }">--%>
                    <%--<div class="col-md-2 title">产品照片</div>--%>
                    <%--<div class="col-md-4 data">--%>
                        <%--还没有照片--%>
                    <%--</div>--%>
                    <%--</c:if>--%>

                    <div class="col-md-2 title">数量</div>
                    <div class="col-md-4 data">
                        <input type="text" class="form-control" placeholder="数量" name="pNumber" value="${factoryProduct.pNumber}">
                    </div>

                    <div class="col-md-2 title">包装单位</div>
                    <div class="col-md-4 data">
                        <div class="form-group form-inline">
                            <div class="radio"><label><input type="radio" ${factoryProduct.packing=="PCS"?'checked':''} name="packing" value="PCS">PCS</label></div>
                            <div class="radio"><label><input type="radio" ${factoryProduct.packing=="SETS"?'checked':''} name="packing" value="SETS">SETS</label></div>
                        </div>
                    </div>


                    <div class="col-md-2 title">市场价</div>
                    <div class="col-md-4 data">
                        <input type="text" class="form-control" placeholder="市场价" name="price" value="${factoryProduct.price}">
                    </div>
                    <div class="col-md-2 title">体积</div>
                    <div class="col-md-4 data">
                        <input type="text" class="form-control" placeholder="体积" name="bulk" value="${factoryProduct.bulk}" readonly="readonly"><%--只读--%>
                    </div>

                    <div class="col-md-2 title">尺寸长</div>
                    <div class="col-md-4 data">
                        <input type="text" class="form-control" placeholder="尺寸长" name="sizeLength" value="${factoryProduct.sizeLength}">
                    </div>

                    <div class="col-md-2 title">尺寸宽</div>
                    <div class="col-md-4 data">
                        <input type="text" class="form-control" placeholder="尺寸宽" name="sizeWidth" value="${factoryProduct.sizeWidth}">
                    </div>

                    <div class="col-md-2 title">尺寸高</div>
                    <div class="col-md-4 data">
                        <input type="text" class="form-control" placeholder="尺寸高" name="sizeHeigth" value="${factoryProduct.sizeHeigth}">
                    </div>

                </div>
            </form>
        </div>
        <!--订单信息/-->

        <!--工具栏-->
        <div class="box-tools text-center">
            <button type="button" onclick='document.getElementById("editForm").submit()' class="btn bg-maroon">修改</button>
            <button type="button" class="btn bg-default" onclick="history.back(-1);">返回</button>
        </div>
        <!--工具栏/-->

    </section>
    <!-- 正文区域 /-->


</div>
<!-- 内容区域 /-->
</body>

</html>